//user小仓库

import { reqLogin } from '@/api'

const state = {
    phone: '',
    password: ''
};

const mutations = {
    LOGIN(state, phone, password) {
        state.phone = phone,
        state.password = password
    }
};

const actions = {
    //登录业务
    async login({ commit }, { phone, password }) {
        console.log('你好');
        console.log(phone, password);
        //用result接收等待登录接口传来的回调
        let result = await reqLogin(phone, password)
        console.log(result);
        // if(result==200){
        //     commit('LOGIN',result.data)
        // }
    }
};

const getters = {

};

export default {
    state, mutations, actions, getters
}